<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>rapidjson: rapidjson::Writer&lt; Stream, Encoding, Allocator &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">rapidjson
   </div>
   <div id="projectbrief">A fast JSON parser/generator for C++ with both SAX/DOM style API</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>rapidjson</b></li><li class="navelem"><a class="el" href="classrapidjson_1_1_writer.html">Writer</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#pro-static-attribs">Static Protected Attributes</a> &#124;
<a href="classrapidjson_1_1_writer-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">rapidjson::Writer&lt; Stream, Encoding, Allocator &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>JSON writer.  
 <a href="classrapidjson_1_1_writer.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="writer_8h_source.html">writer.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for rapidjson::Writer&lt; Stream, Encoding, Allocator &gt;:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classrapidjson_1_1_writer.png" usemap="#rapidjson::Writer&lt; Stream, Encoding, Allocator &gt;_map" alt=""/>
  <map id="rapidjson::Writer&lt; Stream, Encoding, Allocator &gt;_map" name="rapidjson::Writer&lt; Stream, Encoding, Allocator &gt;_map">
<area href="classrapidjson_1_1_handler.html" title="Concept for receiving events from GenericReader upon parsing." alt="rapidjson::Handler" shape="rect" coords="0,0,322,24"/>
<area href="classrapidjson_1_1_pretty_writer.html" title="Writer with indentation and spacing." alt="rapidjson::PrettyWriter&lt; Stream, Encoding, Allocator &gt;" shape="rect" coords="0,112,322,136"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structrapidjson_1_1_writer_1_1_level.html">Level</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Information for each nested level.  <a href="structrapidjson_1_1_writer_1_1_level.html#details">More...</a><br/></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a8c1a78151ed0569518c70bce697d3893"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8c1a78151ed0569518c70bce697d3893"></a>
typedef Encoding::Ch&#160;</td><td class="memItemRight" valign="bottom"><b>Ch</b></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a2a086f557b127c6e8c9937186aed384c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2a086f557b127c6e8c9937186aed384c"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>Writer</b> (<a class="el" href="classrapidjson_1_1_stream.html">Stream</a> &amp;stream, <a class="el" href="classrapidjson_1_1_allocator.html">Allocator</a> *allocator=0, size_t levelDepth=kDefaultLevelDepth)</td></tr>
<tr class="memitem:a4d69e0fa29dc66a0b1989bdb4c234fbf"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4d69e0fa29dc66a0b1989bdb4c234fbf"></a>
<a class="el" href="classrapidjson_1_1_writer.html">Writer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrapidjson_1_1_writer.html#a4d69e0fa29dc66a0b1989bdb4c234fbf">String</a> (const Ch *str)</td></tr>
<tr class="memdesc:a4d69e0fa29dc66a0b1989bdb4c234fbf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Simpler but slower overload. <br/></td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr class="memitem:adc51de93de666b07fbe7791bbafb5d2f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adc51de93de666b07fbe7791bbafb5d2f"></a>
<a class="el" href="classrapidjson_1_1_writer.html">Writer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>Null</b> ()</td></tr>
<tr class="memitem:a81e98004195d74dba35beadd052b97df"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a81e98004195d74dba35beadd052b97df"></a>
<a class="el" href="classrapidjson_1_1_writer.html">Writer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>Bool</b> (bool b)</td></tr>
<tr class="memitem:a9c570f4e4842a091cc7abaf55b4caeb2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9c570f4e4842a091cc7abaf55b4caeb2"></a>
<a class="el" href="classrapidjson_1_1_writer.html">Writer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>Int</b> (int i)</td></tr>
<tr class="memitem:a0c37ebf2a1649db3bc1f957b835bb3a1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0c37ebf2a1649db3bc1f957b835bb3a1"></a>
<a class="el" href="classrapidjson_1_1_writer.html">Writer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>Uint</b> (unsigned u)</td></tr>
<tr class="memitem:a80a2976d1471e44c32f0cf6adcb4ad3e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a80a2976d1471e44c32f0cf6adcb4ad3e"></a>
<a class="el" href="classrapidjson_1_1_writer.html">Writer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>Int64</b> (int64_t i64)</td></tr>
<tr class="memitem:a7f5e4f224fb8df86e0156ee919bf7efc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7f5e4f224fb8df86e0156ee919bf7efc"></a>
<a class="el" href="classrapidjson_1_1_writer.html">Writer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>Uint64</b> (uint64_t u64)</td></tr>
<tr class="memitem:a15ce937cac44e4ba1f5ec952d447c41d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a15ce937cac44e4ba1f5ec952d447c41d"></a>
<a class="el" href="classrapidjson_1_1_writer.html">Writer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>Double</b> (double d)</td></tr>
<tr class="memitem:a291115a14a4a3074c01a42739dc7ab19"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a291115a14a4a3074c01a42739dc7ab19"></a>
<a class="el" href="classrapidjson_1_1_writer.html">Writer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>String</b> (const Ch *str, SizeType length, bool copy=false)</td></tr>
<tr class="memitem:a934b84c3107feabda00e7752e20c2877"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a934b84c3107feabda00e7752e20c2877"></a>
<a class="el" href="classrapidjson_1_1_writer.html">Writer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>StartObject</b> ()</td></tr>
<tr class="memitem:a668cecd156d8e3ff2c7450ecbf9c3bcc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a668cecd156d8e3ff2c7450ecbf9c3bcc"></a>
<a class="el" href="classrapidjson_1_1_writer.html">Writer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>EndObject</b> (SizeType memberCount=0)</td></tr>
<tr class="memitem:a6f787a10131c634fe3110f2d75d6d155"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6f787a10131c634fe3110f2d75d6d155"></a>
<a class="el" href="classrapidjson_1_1_writer.html">Writer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>StartArray</b> ()</td></tr>
<tr class="memitem:ab448d5678bc23fbe300375329e64dd3a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab448d5678bc23fbe300375329e64dd3a"></a>
<a class="el" href="classrapidjson_1_1_writer.html">Writer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>EndArray</b> (SizeType elementCount=0)</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a1762e0732171c9eaff730afbf4058452"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1762e0732171c9eaff730afbf4058452"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>WriteNull</b> ()</td></tr>
<tr class="memitem:ab3584400f03c1aaa4c9765b165f87a32"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab3584400f03c1aaa4c9765b165f87a32"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>WriteBool</b> (bool b)</td></tr>
<tr class="memitem:ad9547d09ebed82711544a7d340b9c509"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad9547d09ebed82711544a7d340b9c509"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>WriteInt</b> (int i)</td></tr>
<tr class="memitem:a6dc992ede0a970865341c2e6a4cf61af"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6dc992ede0a970865341c2e6a4cf61af"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>WriteUint</b> (unsigned u)</td></tr>
<tr class="memitem:a70fae2f73dcc61e9aefe5b0df8b303d4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a70fae2f73dcc61e9aefe5b0df8b303d4"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>WriteInt64</b> (int64_t i64)</td></tr>
<tr class="memitem:a943eb0356214a84d46c173d41dac2600"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a943eb0356214a84d46c173d41dac2600"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>WriteUint64</b> (uint64_t u64)</td></tr>
<tr class="memitem:a6b022dcd0eda4530584b0a8c62f745f4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrapidjson_1_1_writer.html#a6b022dcd0eda4530584b0a8c62f745f4">WriteDouble</a> (double d)</td></tr>
<tr class="memitem:a3c1c64b475d6b8be7a98ce687c1f0973"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3c1c64b475d6b8be7a98ce687c1f0973"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>WriteString</b> (const Ch *str, SizeType length)</td></tr>
<tr class="memitem:a74a6030b42f1b98db5d6ec021c53e7bd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a74a6030b42f1b98db5d6ec021c53e7bd"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>WriteStartObject</b> ()</td></tr>
<tr class="memitem:ab281224458ec9072b07ee30792e4904c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab281224458ec9072b07ee30792e4904c"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>WriteEndObject</b> ()</td></tr>
<tr class="memitem:a198690e1275092ead49f94a9a0b8116c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a198690e1275092ead49f94a9a0b8116c"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>WriteStartArray</b> ()</td></tr>
<tr class="memitem:ae3ec0fa50a4cb56a88f70bad215fbe6b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae3ec0fa50a4cb56a88f70bad215fbe6b"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>WriteEndArray</b> ()</td></tr>
<tr class="memitem:ad5d6163c7594f3e661a64de4b3a4c29c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad5d6163c7594f3e661a64de4b3a4c29c"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>Prefix</b> (Type type)</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:aa24d9ae71f2cfbec533d13ebbb92aed1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa24d9ae71f2cfbec533d13ebbb92aed1"></a>
<a class="el" href="classrapidjson_1_1_stream.html">Stream</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>stream_</b></td></tr>
<tr class="memitem:a9d1d2b157af63ae9be1b721b7a68b41b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9d1d2b157af63ae9be1b721b7a68b41b"></a>
<a class="el" href="classrapidjson_1_1internal_1_1_stack.html">internal::Stack</a>&lt; <a class="el" href="classrapidjson_1_1_allocator.html">Allocator</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>level_stack_</b></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pro-static-attribs"></a>
Static Protected Attributes</h2></td></tr>
<tr class="memitem:a480a53e57c311fe6d8dee227e6d1c2aa"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a480a53e57c311fe6d8dee227e6d1c2aa"></a>
static const size_t&#160;</td><td class="memItemRight" valign="bottom"><b>kDefaultLevelDepth</b> = 32</td></tr>
</table>
<a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename Stream, typename Encoding = UTF8&lt;&gt;, typename Allocator = MemoryPoolAllocator&lt;&gt;&gt;<br/>
class rapidjson::Writer&lt; Stream, Encoding, Allocator &gt;</h3>

<p>JSON writer. </p>
<p><a class="el" href="classrapidjson_1_1_writer.html" title="JSON writer.">Writer</a> implements the concept <a class="el" href="classrapidjson_1_1_handler.html" title="Concept for receiving events from GenericReader upon parsing.">Handler</a>. It generates JSON text by events to an output stream.</p>
<p>User may programmatically calls the functions of a writer to generate JSON text.</p>
<p>On the other side, a writer can also be passed to objects that generates events,</p>
<p>for example <a class="el" href="classrapidjson_1_1_generic_reader.html#a62a1014258b1f716acc22782ee1cb269" title="Parse JSON text.">Reader::Parse()</a> and <a class="el" href="classrapidjson_1_1_generic_value.html#ac9787450c50b9ba3236de8c58d53df10" title="Generate events of this value to a Handler.">Document::Accept()</a>.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname"><a class="el" href="classrapidjson_1_1_stream.html" title="Concept for reading and writing characters.">Stream</a></td><td>Type of ouptut stream. </td></tr>
    <tr><td class="paramname"><a class="el" href="classrapidjson_1_1_encoding.html" title="Concept for encoding of Unicode characters.">Encoding</a></td><td><a class="el" href="classrapidjson_1_1_encoding.html" title="Concept for encoding of Unicode characters.">Encoding</a> of both source strings and output. </td></tr>
  </table>
  </dd>
</dl>
</div><h2>Member Function Documentation</h2>
<a class="anchor" id="a6b022dcd0eda4530584b0a8c62f745f4"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Stream , typename Encoding  = UTF8&lt;&gt;, typename Allocator  = MemoryPoolAllocator&lt;&gt;&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classrapidjson_1_1_writer.html">rapidjson::Writer</a>&lt; <a class="el" href="classrapidjson_1_1_stream.html">Stream</a>, <a class="el" href="classrapidjson_1_1_encoding.html">Encoding</a>, <a class="el" href="classrapidjson_1_1_allocator.html">Allocator</a> &gt;::WriteDouble </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>d</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000001">Todo:</a></b></dt><dd>Optimization with custom double-to-string converter. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>D:/rapidjson_version0.1x/include/rapidjson/<a class="el" href="writer_8h_source.html">writer.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Nov 16 2012 21:08:20 for rapidjson by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.2
</small></address>
</body>
</html>
